<template>
  <div class="info">
    <div class="info-content">
      <el-card class="right" shadow="never">
        <div>
          <el-tabs v-model="tabsActive" class="info_tab">
            <el-tab-pane label="项目概括" name="1" lazy>
              <Summarize :id="id"/>
            </el-tab-pane>
            <el-tab-pane label="项目详情" name="2" lazy>
              <Details :id="id"/>
            </el-tab-pane>
            <el-tab-pane label="项目任务" name="3" lazy>
              <Task :id="id" :name="name" :percent_residue="percent_residue" :project_number="project_number"
                    :work_hour="work_hour"
                    :is_charge_person="is_charge_person"
              />
            </el-tab-pane>
            <el-tab-pane label="管理设备" name="4" lazy>
              <Equipment :id="id"/>
            </el-tab-pane>
            <el-tab-pane label="项目意见" name="5" lazy>
              <Feedback :id="id" />
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
import Summarize from "@/views/project/projectList/info/components/summarize";
import Details from "@/views/project/projectList/info/components/details";
import Task from "@/views/project/projectList/info/components/task";
import Equipment from "@/views/project/projectList/info/components/equipment/index.vue";
import Feedback from "@/views/project/feedback/index.vue";

export default {
  components: {
    Summarize,
    Details,
    Task,
    Equipment,
    Feedback
  },
  data() {
    return {
      id: null, //  id
      name: null,
      percent_residue: null,
      tabsActive: "1",
      loading: false,
      project_number: null,
      work_hour: null,
      is_charge_person: null,
    }
  },
  created() {
    this.id = this.$route.query.id; //获取传来的参数
    this.name = this.$route.query.name
    this.percent_residue = this.$route.query.percent_residue
    this.project_number = this.$route.query.project_number
    this.work_hour = this.$route.query.plan_work_hour
    this.is_charge_person = this.$route.query.is_charge_person
    // this.loadData();
  },
  methods: {
    loadData() {
      this.loading = true
      this.$http.get(`tasks/${this.id}`).then((res) => {
        if (res.data.code === 0)
          this.customerInfo = res.data.data;
        else
          this.$message.error(res.data.msg);
        this.loading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>


.info {
  width: 96%;
  margin: 10px auto 0;
}
</style>
